package com.gis3c.sys.dao.impl;

import com.gis3c.sys.dao.SystemDao;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2017/11/13 0013.
 */
@Repository("systemDao")
public class SystemDaoImpl extends SqlSessionDaoSupport implements SystemDao {
    @Resource(name="sqlSessionFactory_sys") private SqlSessionFactory sqlSessionFactory;

    @Override
    public List<String> queryAllTableNames(){
        return getSqlSession().selectList("SystemSql.queryAllTableNames");
    }

    @PostConstruct
    public void injectSessionFactory(){
        super.setSqlSessionFactory(sqlSessionFactory);
    }
}
